1. /* sfostrm.cpp by K.Tsuru */
  2. // function ID = 7004
  3. /**************************
  4. SComplex class
  5. It provides the output.
  6. **************************/
  7. #ifndef SN_H
  8. #include "sn.h"
  9. #endif
  10. // static objects of SFFormat class
  11. int SFFormat::sfLineFormat = SFFormat::BRACKET; // set by BRACKET | END_CR | MID_CR
  12. void SFFormat::SetSFFormat(int fmt, long fig) {
  13. sfLineFormat = fmt; figUnit = fig;
  14. }
  15. // output stream SFraction class.7004
  16. ostream& operator<<(ostream& os, SFraction& sf) { // "sf" is not const
  17. SLong tmp;
  18. long p = 0;
  19. if(sf.sfLineFormat & sf.BRACKET) { os << '('; p++; }
  20. os << sf.Num(); p += tmp.ioCount;
  21. os << '/'; p++;
  22. if(sf.sfLineFormat & sf.MID_CR) { os << endl; p++; }
  23. tmp.ioCount = 0;
  24. os << sf.Den(); p += tmp.ioCount;
  25. if(sf.sfLineFormat & sf.BRACKET) { os << ')'; p++; }
  26. if(sf.sfLineFormat & sf.END_CR) { os << endl; p++; }
  27. sf.ioCount = p;
  28. return os;
  29. }

sfostrm.cpp : last modifiled at 2016/04/20 14:25:55(913 bytes)
created at 2015/12/22 16:07:29
The creation time of this html file is 2016/09/17 15:33:55 (Sat Sep 17 15:33:55 2016).